package String.homework;

import java.util.Scanner;

/**
 * @author Justin Parker
 * @author 2024/7/11 22:43
 * @version 1.0
 */
public class Test02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名：");
        String name = sc.nextLine();
        if (name == null || name.length()==0){
            System.out.println("用户名为空！");
            return;
        }
        if (name.length()<=1||name.length()>20) {
            System.out.println("用户名长度不符合要求,请重新输入");
        }else {
            System.out.println("用户名格式正确");
            System.out.println(name);
        }
    }
}
